export function bitsToArray(bits: number): number[] {
  const array = []
  for (let i = 0; bits > 0; i++) {
    if ((bits & 1) > 0) array.push(1 << i)
    bits >>= 1
  }
  return array
}

export function bitsToIndexArray(bits: number): number[] {
  const array = []
  for (let i = 0; bits > 0; i++) {
    if ((bits & 1) > 0) array.push(i)
    bits >>= 1
  }
  return array
}

